package com.dldata.devtools30.entity;

import jakarta.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "devt_model_metadata_field" )
public class DevtModelMetadataFieldEntity {

    @Id
    @Column(name = "id", nullable = false, insertable = true, updatable = true, length = 64)
    private String id;

    @Basic
    @Column(name = "form_id", nullable = true, insertable = true, updatable = true, length = 64)
    private String formId;

    @Basic
    @Column(name = "field_name", nullable = true, insertable = true, updatable = true, length = 64)
    private String fieldName;

    @Basic
    @Column(name = "field_code", nullable = true, insertable = true, updatable = true, length = 64)
    private String fieldCode;

    @Basic
    @Column(name = "field_type", nullable = true, insertable = true, updatable = true, length = 100)
    private String fieldType;

    @Basic
    @Column(name = "xh", nullable = true, insertable = true, updatable = true)
    private Integer xh;

    @Basic
    @Column(name = "pkey", nullable = true, insertable = true, updatable = true)
    private Integer pkey;

    @Basic
    @Column(name = "type_length", nullable = true, insertable = true, updatable = true)
    private Integer typeLength;

    @Basic
    @Column(name = "type_zero_length", nullable = true, insertable = true, updatable = true)
    private Integer typeZeroLength;

    @Basic
    @Column(name = "bz", nullable = true, insertable = true, updatable = true, length = 1024)
    private String bz;

    @Basic
    @Column(name = "tabletype", nullable = true, insertable = true, updatable = true, length = 100)
    private String tabletype;
    @Basic
    @Column(name = "patienttable", nullable = true, insertable = true, updatable = true, length = 255)
    private String patienttable;
    @Basic
    @Column(name = "patienttablefield", nullable = true, insertable = true, updatable = true, length = 100)
    private String patienttablefield;



    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getFormId() {
        return formId;
    }

    public void setFormId(String formId) {
        this.formId = formId;
    }

    public String getFieldName() {
        return fieldName;
    }

    public String getTabletype() {
        return tabletype;
    }

    public void setTabletype(String tabletype) {
        this.tabletype = tabletype;
    }

    public String getPatienttable() {
        return patienttable;
    }

    public void setPatienttable(String patienttable) {
        this.patienttable = patienttable;
    }

    public String getPatienttablefield() {
        return patienttablefield;
    }

    public void setPatienttablefield(String patienttablefield) {
        this.patienttablefield = patienttablefield;
    }

    public void setFieldName(String fieldName) {
        this.fieldName = fieldName;
    }

    public String getFieldCode() {
        return fieldCode;
    }

    public void setFieldCode(String fieldCode) {
        this.fieldCode = fieldCode;
    }

    public String getFieldType() {
        return fieldType;
    }

    public void setFieldType(String fieldType) {
        this.fieldType = fieldType;
    }


    public Integer getXh() {
        return xh;
    }

    public void setXh(Integer xh) {
        this.xh = xh;
    }

    public Integer getPkey() {
        return pkey;
    }

    public void setPkey(Integer pkey) {
        this.pkey = pkey;
    }

    public Integer getTypeLength() {
        return typeLength;
    }

    public void setTypeLength(Integer typeLength) {
        this.typeLength = typeLength;
    }

    public Integer getTypeZeroLength() {
        return typeZeroLength;
    }

    public void setTypeZeroLength(Integer typeZeroLength) {
        this.typeZeroLength = typeZeroLength;
    }

    public String getBz() {
        return bz;
    }

    public void setBz(String bz) {
        this.bz = bz;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        DevtModelMetadataFieldEntity that = (DevtModelMetadataFieldEntity) o;
        return Objects.equals(id, that.id) &&
                Objects.equals(formId, that.formId) &&
                Objects.equals(fieldName, that.fieldName) &&
                Objects.equals(fieldCode, that.fieldCode) &&
                Objects.equals(fieldType, that.fieldType) &&

                Objects.equals(xh, that.xh) &&
                Objects.equals(pkey, that.pkey) &&
                Objects.equals(typeLength, that.typeLength) &&
                Objects.equals(typeZeroLength, that.typeZeroLength) &&
                Objects.equals(bz, that.bz);
    }

    @Override
    public int hashCode() {

        return Objects.hash(id, formId, fieldName, fieldCode, fieldType, xh, pkey, typeLength, typeZeroLength, bz);
    }
}
